﻿@using SCMS.Resource
@model SCMS.UI.Models.BudgetCategory
@{
    AjaxOptions ajaxOpts = new AjaxOptions { UpdateTargetId = "budgetDiv", 
        LoadingElementId = "loading", 
        HttpMethod = "Post", 
        Url = Url.Action("SaveCategory"),
        OnSuccess="ClearForm"};
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form" }))
{ 
    <table>
        
        <tbody>            
            <tr>
                <td align="right">@Resources.Budget_CreateCategory_CategoryNo<font color="red">*</font>:</td>
                <td>
                    @Html.TextBoxFor(model => model.Number, new { @autocomplete = "off"})<br />
                    @Html.ValidationMessageFor(model => model.Number)
                </td>
            </tr>
            <tr>
                <td align="right">@Resources.Budget_CreateCategory_CategoryName<font color="red">*</font>:</td>
                <td>
                    @Html.TextBoxFor(model => model.Name, new { @autocomplete = "off" })<br />
                    @Html.ValidationMessageFor(model => model.Name)
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    @Html.HiddenFor(p => p.BudgetCategoryId)
                    @Html.HiddenFor(p => p.EntityBudgetCategory.Id)
                    @Html.HiddenFor(p => p.EntityBudgetCategory.ProjectDonorId)
                    <input type="submit" class="btn green"  value="@ViewBag.ButtonText" />&nbsp;
                    <input type="button" class="btn green"  value="@Resources.Global_String_Cancel" onclick="javascript:CloseDialog()" />
                </td>
            </tr>
         </tbody>
    </table>
}  